package POO;


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author kelyane
 */
public class TecladoUtils {
    
    //Estruturas de leitura e retorno conforme o tipo de dado que o usuario precisa digitar
    
    public static String lerString() throws IOException{
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);        
        return br.readLine();
    }
    
    public static Integer lerInteiro() throws IOException{
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);        
        return Integer.valueOf(br.readLine());
    }
    
    public static Boolean lerBoolean() throws IOException{           
        System.out.printf("| 1-SIM ou 0-NAO |\n");
        int opcao = lerInteiro();
        return opcao == 1;
    }
    
    
}
